import { BingSearchEngine } from "./engines/bing";

class SearchResult {
  title: string;
  url: string;
  content: string;
}
interface SearchEngineInterface {
  search(query: string): Promise<SearchResult[]>;
}

const getSearchEngine = (searchEngine: string): SearchEngineInterface => {
  switch (searchEngine) {
  case "bing":
    return new BingSearchEngine();
  default:
    throw new Error(`Invalid search engine: ${searchEngine}`);
  }
};


export { SearchResult, SearchEngineInterface,getSearchEngine };
